package com.sikaryofficial.backend.loader;

import com.sikaryofficial.backend.annotation.TenantFilter;
import com.sikaryofficial.backend.service.activity.ActivityCacheService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @author : qinjinyuan
 * @desc : 加载有效活动的积分信息
 * @date : 2023/11/29 9:28
 */
@Component
@Slf4j
public class ActivityPointLoader implements CommandLineRunner {

    @Autowired
    private ActivityCacheService activityCacheService;
    /**
     * @param args
     * @throws Exception
     */
    @Override
    @TenantFilter
    public void run(String... args) {
        activityCacheService.loadAllPoints();
    }
}
